/*加载中弹窗
* 带文字*/
import 'package:flutter/material.dart';

class LoadingDialog extends Dialog {
  String text;

  LoadingDialog({Key? key, required this.text}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    //创建透明层
    return Material(
      //透明类型
      type: MaterialType.transparency,
      child: Center(
        child: SizedBox(
          width: 120,
          height: 120,
          child: Container(
            decoration: ShapeDecoration(
              color: Colors.white,
              shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(8)),
              )
            ),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                CircularProgressIndicator(),
                Padding(padding: EdgeInsets.only(top: 20),
                child: Text(text,style: TextStyle(fontSize: 12,color: Colors.black),),)
              ],

            ),
          ),
        ),
      ),
    );
  }
}
